GBML manual / Save

save_set

Writes value (int, real or bool) into the save store’s in-RAM working copy under key. Does not itself reach SRAM - call save_commit to make it survive a power cycle.

Syntax

save_set(key, value)

Arguments

NameType
keystring
valueany

Returns

Nothing.

Description

Writes value (an int, real or bool) into the save store's in-RAM working copy under key. This alone does not reach SRAM - call save_commit to make it survive a power cycle. Calling save_set on its own is cheap and fine to do often (every kill, every pickup); it is save_commit that should be reserved for an actual save point, since that is the call that costs a real SRAM write.

Example

save_set("high_score", 100);

Writes a value into the working copy under the key "high_score" - not yet on SRAM until save_commit is called.

On the GBA

A key longer than 15 characters is truncated, not refused (GBML has no exceptions to refuse one with).

See also: save_getsave_commit